package com.hz.springboot02.service.impl;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.springboot02.mapper.ProviderMapper;
import com.hz.springboot02.pojo.Provider;
import com.hz.springboot02.service.ProviderService;
import com.hz.springboot02.utils.MessageJson;
import com.hz.springboot02.utils.ResultLayUi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName ProviderServiceImpl
 * @Description 供应商业务逻辑实现
 * @Author Administrator
 * @Date 2024/12/3 9:46
 */
@Service
public class ProviderServiceImpl extends ServiceImpl<ProviderMapper,Provider> implements ProviderService {


@Resource
  private ProviderMapper providerMapper;
//
//    public MessageJson delById(Integer id) {
//        return  providerMapper.delById(id)>0? MessageJson.success(): MessageJson.error();
//    }
//
//
//    public MessageJson editProOrAddPro(Provider provider) {
//        return MessageJson.successOrError(provider.getId()!=null?providerMapper.edit(provider):providerMapper.insert(provider));
//    }

//    public Provider selectById(Integer id) {
//        return providerMapper.selectById(id);
//    }
//
//    public ResultLayUi listPage(Integer page, Integer limit, String proCode, String proName, String proDesc, String beginDate, String endDate) {
//        return ResultLayUi.success(providerMapper.sumNo(proCode,proName,proDesc,beginDate,endDate),providerMapper.listPage((page-1)*limit,limit,proCode,proName,proDesc,beginDate,endDate));
//    }
//
//    public MessageJson delIds(List<Integer> ids) {
//        providerMapper.delIds(ids);
//        return (ids != null && ids.size() > 0)? MessageJson.success(): MessageJson.error();
//    }

     @Override
        public MessageJson proList() {

            return MessageJson.success(providerMapper.proList());

        }

}
